# -*- coding: utf-8 -*-
from neo4j import GraphDatabase

from conf.variable import NEO_CONFIG


class NeoCnxPool:

    def __init__(self):
        self.neo_driver = GraphDatabase.driver(uri=NEO_CONFIG['uri'],
                                               auth=(NEO_CONFIG['user'],
                                                     NEO_CONFIG['pswd']))

    def get_session(self):
        return self.neo_driver.session()

    def close(self):
        self.neo_driver.close()
